export * from './math';
export function removeEmptyObjects(params: any) {
  const emptyList = ['', undefined, null];
  if (typeof params !== 'object' || params === 'null') return params;
  if (Array.isArray(params)) {
    return params.reduce((pre: any[], value) => {
      if (!emptyList.includes(value)) {
        pre.push(removeEmptyObjects(value));
      }
      return pre;
    }, []);
  } else {
    return Object.entries(params).reduce((pre: Record<string, any>, [key, value]) => {
      if (!emptyList.includes(value)) {
        pre[key] = removeEmptyObjects(value);
      }
      return pre;
    }, {});
  }
}
